package com.ycp.erp.login.mobel;

import com.one.common.common.system.model.response.UserInfoResponse;
import com.one.common.model.http.base.CommonParam;
import com.one.common.model.http.base.CommonResponse;
import com.ycp.erp.login.mobel.response.DefaultResponse;

import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.POST;

/**
 * Author: zhulunjun
 * Email: zhulunjun@qq.com
 * CreateDate: 2018/11/15 19:17
 * Description：登录模块接口
 **/
public interface LoginApi {

    /**
     * 发送验证码
     */
    String SEND_CODE = "user.sendnote";
    @POST("ycp/cuser-server/user/sendnote")
    Observable<CommonResponse<DefaultResponse>> sendCode(@Body CommonParam params);

    /**
     * 登录
     */
    String LOGIN = "user.userlogin";
    @POST("ycp/cuser-server/user/userlogin")
    Observable<CommonResponse<UserInfoResponse>> login(@Body CommonParam params);

    /**
     * 注册
     */
    String REGISTER = "user.useregister";
    @POST("ycp/cuser-server/user/useregister")
    Observable<CommonResponse<UserInfoResponse>> register(@Body CommonParam params);

    /**
     * 校验验证码(找回密码用)
     */
    String CHECK_CODE = "user.checkoutcode";
    @POST("ycp/cuser-server/user/checkoutcode")
    Observable<CommonResponse<DefaultResponse>> checkCode(@Body CommonParam params);

    /**
     * 修改密码/设置密码
     */
    String SET_PWD = "user.updateloginword";
    @POST("ycp/cuser-server/user/updateloginword")
    Observable<CommonResponse<DefaultResponse>> setPwd(@Body CommonParam params);

    /**
     * 验证旧密码
     */
    String CHECK_OLD_PWD = "user.checkoldword";
    @POST("ycp/cuser-server/user/checkoldword")
    Observable<CommonResponse<DefaultResponse>> checkOldPwd(@Body CommonParam params);

    /**
     * 退出登录
     */
    String LOGOUT = "user.userloginout";
    @POST("ycp/cuser-server/user/userloginout")
    Observable<CommonResponse<DefaultResponse>> logout(@Body CommonParam params);

    String MODIFYPHONE = "user.vehicleOwnerUpdateMobile";
    @POST("ycp/cuser-server/user/vehicleOwnerUpdateMobile")
    Observable<CommonResponse<DefaultResponse>> modifyPhone(@Body CommonParam params);

    String MODIFYPHONEATLOGIN = "user.userLoginMobileUpdate";
    @POST("ycp/cuser-server/user/userLoginMobileUpdate")
    Observable<CommonResponse<DefaultResponse>> modifyPhoneAtLogin(@Body CommonParam params);

}
